Design of Multithreaded Software by Bo I. Sandén

Design of Multithreaded Software by Bo I. Sandén

Author:Bo I. Sandén
Language: eng
Format: epub
ISBN: 9781118102732
Publisher: John Wiley & Sons
Published: 2011-04-04T16:00:00+00:00


The sequential-activities implementation of the bicycle odometer in Section 5.3.3 illustrates implicit state representation. Another example is an operator thread (Section 4.3.1.1) that steps through a series of interactions with a human user. Thus an ATM thread may be in a state S1 when waiting for a card to be inserted, in state S2 when waiting for a password, in state S3 when waiting for the user to choose a function, and so on. Identifying and naming all those trivial states is tiresome, unneeded, and sometimes even error prone. We are quite accustomed to such calls appearing one after the other in the program text however.

The Job threads in the FMS problem (Section 7.3.2.2) are sequential-activities threads, too. They are chiefly resource-user threads and can spend much of their time waiting for access. Here’s a slightly simplified version of the Job thread pseudocode:

Get information about first job step

while (not done)

Acquire workstation instand

Acquire storage stand

Acquire forklift

Travel to storage stand

Release forklift

while (True)

Acquire AGV

Travel to instand

Release storage stand or outstand, and AGV

Wait for job to appear on outstand

Get information about next job step

Break from inner loop if job done

Acquire instand of workstation for next step

Acquire storage stand // Continue here when job done

Acquire AGV

Travel to storage stand

Release AGV

Acquire forklift

Travel to bin

Release storage stand and forklift



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.